<template>
  <div class="alet_container">
    <section class="tip_text_container">
      <div class="tip_icon">
        <span></span>
        <span></span>
      </div>
      <p class="tip_text">{{alertText}}</p>
      <div class="confrim" @click="closeTip">确认</div>
    </section>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        positionY: 0,
        timer: null,
      }
    },
    mounted() {

    },
    props: ['alertText'],
    methods: {
      closeTip() {
        this.$emit('closeTip')
      }
    }
  }
</script>

<style lang="scss" scoped>
  @mixin sc($size, $color){
    font-size: $size;
    color: $color;
  }
  @keyframes tipMove {
    0% {
      transform: scale(1)
    }
    35% {
      transform: scale(.8)
    }
    70% {
      transform: scale(1.1)
    }
    100% {
      transform: scale(1)
    }
  }

  .alet_container {
    background: rgba(0,0,0,0.6);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 200;
  }

  .tip_text_container {
    position: absolute;
    top: 50%;
    left: 50%;
    margin-top: -5rem;
    margin-left: -4rem;
    width: 8rem;
    animation: tipMove .4s;
    background-color: rgba(255, 255, 255, 1);
    border: 1px;
    padding-top: .6rem;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    border: 1px;
    border-radius: 0.25rem;
    .tip_icon {
      width: 3rem;
      height: 3rem;
      border: 0.15rem solid #f8cb86;
      border-radius: 50%;
      display: flex;
      justify-content: center;
      align-items: center;
      flex-direction: column;
      span:nth-of-type(1) {
        width: .12rem;
        height: 1.5rem;
        background-color: #f8cb86;
      }
      span:nth-of-type(2) {
        width: 0.2rem;
        height: 0.2rem;
        border: 1px;
        border-radius: 50%;
        margin-top: .2rem;
        background-color: #f8cb86;
      }
    }
    .tip_text {
      @include sc(.4rem, #333);
      line-height: .8rem;
      text-align: center;
      margin-top: .8rem;
      padding: 0 .4rem;
    }
    .confrim {
      @include sc(.7rem, #fff);
      font-weight: bold;
      margin-top: .8rem;
      background-color: #fb3519;
      width: 100%;
      text-align: center;
      line-height: 1.4rem;
      border: 1px;
      border-bottom-left-radius: 0.25rem;
      border-bottom-right-radius: 0.25rem;
    }
  }

</style>
